﻿using ArtMath.Resource;
using System.ComponentModel;

namespace ArtMath.Attribute
{
    public class MultilingualDisplayNameAttribute : DisplayNameAttribute
    {
        string format;
        string[] args;
        public MultilingualDisplayNameAttribute(string displayName) : this(null, displayName)
        {

        }
        public MultilingualDisplayNameAttribute(string format, params string[] args)
        {
            this.format = Resources.GetFormatString(format, args.Length);
            this.args = args;
        }
        public override string DisplayName
        {
            get
            {
                return Resources.GetLocalizedString(format, args);
            }
        }
    }
}
